package com.develop.data.loan.manager.change.amount;

import com.develop.data.loan.manager.change.amount.api.LoanInstallmentAmountBudget;
import com.develop.data.loan.model.LoanInstallment;
import org.javamoney.moneta.Money;
import org.springframework.stereotype.Component;

import javax.money.Monetary;
import javax.money.MonetaryAmount;
import java.time.LocalDateTime;

@Component("L0001B0001LoanInstallmentInterestPenaltyClear")
public class L0001B0001LoanInstallmentInterestPenaltyClear implements LoanInstallmentAmountBudget {

    /* 已发生形态转移 */
    /* 持有时间，左受制于动帐时间，右受制于转非应计时间（不计息） */
    /* LoanInstallmentInterestOverdue对应Installment的InterestOverdue金额字段 */

    public MonetaryAmount preview(LoanInstallment installment, LocalDateTime localDate){

        return Money.zero(Monetary.getCurrency("CNY"));
    }

    public MonetaryAmount execute(LoanInstallment loanInstallment, LocalDateTime localDate, MonetaryAmount amount){

        /* 有借必有贷 */
        /* 还款金额任意，按金额依次扣除，直到扣完 */

        return Money.zero(Monetary.getCurrency("CNY"));
    }
}
